/** 
 * 
 */
package org.acsis.covoiturage.frontend.validators;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Abdellah
 *
 */
public class LoginValidator {

	static public boolean loginNotValid(String login){
		Pattern pattern = Pattern.compile("^[A-Za-z0-9_-]{3,16}$");
		Matcher matcher = pattern.matcher(login);
		if (matcher.matches()) {
			return false;
		} else {
			return true;
		}
	}
	
	static public boolean motDePasseNotValid(String motdepasse){
		Pattern pattern = Pattern.compile("^[a-z0-9A-Z_-]{6,18}$");
		Matcher matcher = pattern.matcher(motdepasse);
		if (matcher.matches()) {
			return false;
		} else {
			return true;
		}
	}
}
